package com.kun;

import org.junit.Test;
import redis.clients.jedis.Jedis;

public class TestJedis {

    @Test
    public void testJedis() {
        //1. 创建Jedis对象，连接Redis主机，需要主机开启redis的6379端口
        Jedis jedis = new Jedis("47.122.113.100", 6379);

        //2.执行Redis命令
        jedis.set("name", "kun");
        System.out.println(jedis.get("name"));

        //3. 关闭连接
        jedis.close();

    }




}
